﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改权限</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<style>
     .son1 {margin-left: 10px;}
    .son2 {margin-left: 20px;}
</style>
<body>
        <form class="am-form tpl-form-line-form" action="{:url('role_store')}" method="post" enctype="multipart/form-data">


            <div class="am-form-group">
                <label for="url" class="am-u-sm-3 am-form-label">角色名称 </label>
                <div class="am-u-sm-9">
                    <input type="text" class="am-form-field tpl-form-no-bg" name="name" id="name" value="{$role.rolename}">
                    <input type="hidden" name="role_id" value="{$Think.get.id}">
                </div>
            </div>

            <div class="am-form-group">
                {foreach name="permission" id="v1" key="k1"}
                <div class="row">
                    <input type="checkbox" name="permission_id[]" value="{$v1.id}" {if condition="in_array($v1.id , $having_permissions_id)"}checked{/if} id="permission-{$v1.id}"> <label
                        for="permission-{$v1.id}">{$v1.personal_name}</label>
                    {if condition="isset($v1['son'])"}
                    <div class="row son1">
                        {foreach name="v1['son']" id="v2" key="k2"}
                        <input type="checkbox" name="permission_id[]" value="{$v2.id}" {if condition="in_array($v2.id , $having_permissions_id)"}checked{/if} id="permission-{$v2.id}"> <label
                            for="permission-{$v2.id}">{$v2.personal_name}</label>
                        {if condition="isset($v2['son'])"}

                        <div class="row son2">
                            {foreach name="v2['son']" id="v3" key="k3"}
                            <input type="checkbox" name="permission_id[]" value="{$v3.id}" {if condition="in_array($v3.id , $having_permissions_id)"}checked{/if} id="permission-{$v3.id}">
                            <label for="permission-{$v3.id}">{$v3.personal_name}</label>
                            {/foreach}
                        </div>

                        {/if}
                        {/foreach}
                    </div>
                    {/if}
                </div>
                {/foreach}
            </div>

            <div class="am-form-group">
                <div class="am-u-sm-9 am-u-sm-push-3">
                    <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                </div>
            </div>
        </form>
</body>
</html>